feat(cli): implement dynamic runtime completions for plugins - #3876
Merged
ItsLemmy merged 2 commits intoAug 15, 2026
Conversation
Collaborator
Reproduced with generated Bash and Fish completions: Both shells append a space, preventing continuation with :entry. Add a provider that
std::replace(safeName.begin(), safeName.end(), ':', '-');This triggers modernize-use-ranges, which is enabled and treated as an error: Use: std::ranges::replace(safeName, ':', '-');This matches the PR’s failed CI state: build and tests passed; lint failed. |
ItsLemmy
marked this pull request as draft
August 15, 2026 04:07
oldirtty
force-pushed
the
feat/dynamic-plugins-completions
branch
from
August 15, 2026 05:21
704b7c6 to
6931bef
Compare
oldirtty
marked this pull request as ready for review
August 15, 2026 05:24
Contributor
Author
Collaborator
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Added a
runtimeProviderfield to thePositionalschema. This allows the completion generators (bash, zsh, fish) to inject shell functions that fetch choices dynamically at runtime.Implemented this specifically for plugins by adding
plugins_enabledandplugins_disabledproviders, hooking them intomsg plugins enable,msg plugins disable, andmsg plugin <entry>.Motivation
Typing out long
author/pluginnames by hand is tedious, and it's hard to remember all the exact names off the top of your head. Initially, I just wanted to implement this for themsg plugincommand so that hitting<TAB>would only suggest currently enabled plugins. However, I realized the other commands could easily make use of this too, likemsg plugins disable(shows only enabled plugins) andmsg plugins enable(shows only disabled plugins).Type of Change
Related Issue
None
Testing
bash,zsh, andfish.noctalia msg plugins disable <TAB>and verified it only lists enabled plugins.noctalia msg plugins enable <TAB>and verified it only lists disabled plugins.noctalia msg plugin <TAB>to ensure the runtime provider triggers correctly on subcommands.just formatandjust testManual Coverage
Screenshots / Videos
Checklist
CONTRIBUTING.md.just formatwith clang-format v22+ installed, or this PR has no code changes.assets/translations/en.json, or this PR adds no new user-facing strings.Additional Notes
The
runtimeProvideris can be extensible. If we ever want to add dynamic completions other type of commands in the future, we just need to drop a new provider tag in the schema and add a quick shell function incompletions.cpp.